# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:       加一
# Name:         质数
# Description:  计算 2000以内的质数,以字典的形式保存
#     eg: {
#         '1到99':[2,3...],
#         '100到999':[101,...],
#         '1000到1999':[...]
#         }
# Author:       加一
# Date:         2019/3/5
#-------------------------------------------------------------------------------

list = ['1-99', '100-999', '1000-1999']
list1 = []
list2 = []
leap = 1
for i in range(1,2000):
    k = int(i/2)+1
    for j in range(2,k):
        if(i%j == 0):
            leap = 0
            break
    if leap:
        list2.append(i)
        if i%97==0:
            list1.append(list2.copy())
            list2.clear()
        if i%997==0:
            list1.append(list2.copy())
            list2.clear()
        elif i%1999==0:
            list1.append(list2.copy())
            list2.clear()
    leap =1
dict1 = dict(zip(list,list1))
print(dict1)